package com.cinema;
import java.io.Serializable;
import java.util.UUID;

public class Ticket implements Serializable {
    private static final long serialVersionUID = 1L;
    private String ticketId;     // 电子票号(GUID)
    private String scheduleId;   // 关联场次ID
    private String seatNum;      // 座位号(例如"3排5号")
    private double price;        // 实际支付金额
    private boolean isRefunded;  // 是否退票

    public Ticket(String scheduleId, String seatNum, double price) {
        this.ticketId = UUID.randomUUID().toString();  // 自动生成唯一ID
        this.scheduleId = scheduleId;
        this.seatNum = seatNum;
        this.price = price;
        this.isRefunded = false;
    }

    // Getter和Setter方法
    public String getTicketId() { return ticketId; }
    public String getScheduleId() { return scheduleId; }
    public String getSeatNum() { return seatNum; }
    public double getPrice() { return price; }
    public boolean isRefunded() { return isRefunded; }
    public void setRefunded(boolean refunded) { isRefunded = refunded; }
}